<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        button {
            width: 100px;
            height: 40px;
        }
    </style>
</head>
<body>
    <button id="btn-1">跳转并添加历史记录</button>
    <button id="btn-2">跳转但禁止返回</button>
    <button id="btn-3">重载</button>
    <script>
        // location
        document.getElementById("btn-1").addEventListener("click", function() {
            window.location.assign("https://baidu.com");
        })
        document.getElementById("btn-2").addEventListener("click", function() {
            window.location.replace("https://baidu.com");
        })
        document.getElementById("btn-3").addEventListener("click", function() {
            window.location.reload()
            // 强制从服务器下载资源
            // window.location.reload(true)
        })
    </script>
</body>
</html>